﻿/**
*人效修改
*/
Chenxin.UI.PeopleNumChgForm = Chenxin.extend(Chenxin.UI.FormCommon,{
    actionUrl:'/service/logic/ShowListEmployee.ashx',
    id:'ShowListEmployee',
    renderTo:'divShowListEmployee',
    winCls:'',
    jqmWidth:600,
    defBBtn:true,
    createForm: function() {
        return Chenxin.FormCommon.PeopleNumChgForm(this.id);
    },
	initFormValidator:function(){
         //生成年月
         $("#YearMonth").formValidator({
            validatorgroup: this.id,
            onshow: "请输入生成年月！",
            onfocus: "生成年月格式：YYYYMM",
            oncorrect: " "
        }).inputValidator({ 
            min: 1,
            empty: {
                leftempty: false,
                rightempty: false,
                emptyerror: "生成年月不能为空！"
            },
            onerror: "生成年月不能为空！"
        });
        //开始时间
         $("#BeginTime").formValidator({
            validatorgroup: this.id,
            onshow: "请输入开始时间！",
            onfocus: "开始时间格式：YYYY-MM-DD",
            oncorrect: " "
        }).inputValidator({ 
            min: 1,
            empty: {
                leftempty: false,
                rightempty: false,
                emptyerror: "开始时间不能为空！"
            },
            onerror: "开始时间不能为空！"
        });
        //结束时间
         $("#EndTime").formValidator({
            validatorgroup: this.id,
            onshow: "请输入结束时间！",
            onfocus: "结束时间格式：YYYY-MM-DD",
            oncorrect: " "
        }).inputValidator({ 
            min: 1,
            empty: {
                leftempty: false,
                rightempty: false,
                emptyerror: "结束时间不能为空！"
            },
            onerror: "结束时间不能为空！"
        });
    },
    createComboList:function(){
        //变更名称
        var ComboTransType = new Chenxin.UI.Combo({
            containerId: '#divTransType',
            name: 'TransType',
            required:true,
            tbxWidth: 105,
            colWidth: 105,
            items: comboCommon.EffTransType
        });
        //职位类型
        var ComboPosition = new Chenxin.UI.Combo({
            containerId: '#divPosition',
            name: 'Position',
            required:true,
            tbxWidth: 105,
            colWidth: 105,
            items: comboCommon.EfficencyPosition
        });
        return [ComboTransType,ComboPosition];
    },
    initEvent: function() {
		/*************事件：日期得到焦点*************/
        $("#YearMonth").focus(function(){
            WdatePicker({
                dateFmt:'yyyyMM',
                oncleared:function(){
                            $(this).blur();
                          },
                onpicked:function(){
                            $(this).blur();
                         }
            });
        });
        $("#BeginTime").focus(function(){
            WdatePicker({
                dateFmt:'yyyy-MM-dd',
                oncleared:function(){
                            $(this).blur();
                          },
                onpicked:function(){
                            $(this).blur();
                         }
            });
        });
        $("#EndTime").focus(function(){
            WdatePicker({
                dateFmt:'yyyy-MM-dd',
                oncleared:function(){
                            $(this).blur();
                          },
                onpicked:function(){
                            $(this).blur();
                         }
            });
        });
    },
    saveSucc: function() {
        this.reloadGrid();
    },
    initComponent: function() {
        Chenxin.UI.PeopleNumChgForm.superclass.initComponent.call(this);
    }
});

Chenxin.FormCommon.PeopleNumChgForm=function(formID){
return '<table class="tbl_f"><tr><th style="width:105px; height:26px;">城市：</th><td><input type="text" id="City" name="City" class="inputbox_n fl" style="width:151px" readonly="readonly"/></td><th>公司：</th><td><input type="text" id="Company" name="Company" class="inputbox_n fl" style="width:151px" readonly="readonly"/></td></tr><tr><th>商圈：</th><td><input type="text" id="businessdistrict" name="businessdistrict" class="inputbox_n fl" style="width:151px" readonly="readonly"/></td><th>门店：</th><td><input type="text" id="Departs" name="Departs" class="inputbox_n fl" style="width:151px" readonly="readonly"/></td></tr><tr><th>姓名：</th><td colspan="3"><input type="text" id="Employee" name="Employee" class="inputbox_n fl" style="width:151px" readonly="readonly"/></td></tr><tr><th>年月：</th><td><input type="text" id="YearMonth" name="YearMonth" class="inputbox_n fl" style="width:151px" readonly="readonly"/></td><th>人数：</th><td><input type="text" id="PeopleNum" name="PeopleNum" class="inputbox_n fl" style="width:151px" /></td></tr><tr><th>开始时间：</th><td><input type="text" id="BeginTime" name="BeginTime" class="inputbox_n fl" style="width:151px" /></td><th>结束时间：</th><td><input type="text" id="EndTime" name="EndTime" class="inputbox_n fl" style="width:151px" /></td></tr><tr><th>类型：</th><td><input type="text" id="ChangType" name="ChangType" class="inputbox_n fl" style="width:151px" /></td><th>变动名称：</th><td><div id="divTransType"style="z-index:1; margin-right: 2px;" class="SelectWrapSingle"></td></tr><tr><th>职位类型：</th><td><div id="divPosition"style="z-index:1; margin-right: 2px;" class="SelectWrapSingle"></td></tr><tr><td colspan="2" ><input type="hidden" name="RecordID" /></td></tr></table>';
};